package com.lc.activiti.config;

import com.lc.activiti.utils.ActivitiUserDetailsManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Title: ActivitiRoleConfiguration
 * @Description:
 * @author: 骆超
 * @date: 2021/5/28 17:17
 */
@Configuration
@Slf4j
public class ActivitiRoleConfiguration {

    @Bean
    public UserDetailsService activitiUserDetailsService() {
        return new ActivitiUserDetailsManager();
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
